home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_2 / guispell-1.0 / rexx / ced / quickwordspell.ced next >
Text File  |  1992-03-25  |  2KB  |  65 lines

  1. /*
  2.  *  QuickWordSpell.ced - ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 3.1ljr (or later) with ARexx Server Mode,
  4.  *  GUISpell version 1.0, CED version 2.12 and PingServer (from VLT).
  5.  *
  6.  *  This version just looks for GUISpell if the word is not found.
  7.  *  This version can be used to setup a spell check as you type
  8.  *  system under CED and possibly other text editors.  Under CED, 
  9.  *  just define a macro for the space bar.  Have the macro perform 
  10.  *  the following: `Send Dos/ARexx command...' QuickWordSpell, space.
  11.  *
  12.  *  Started around: Sat Jan 05 03:51:37 1991  LJR
  13.  *  Hacked on a bit: Thu Jan 17 17:17:26 1991  LJR
  14.  *  Finished: Fri Feb  1 06:41:08 1991  LJR
  15.  *  Updated for OS 2.04: LJR  Sat Nov 23 17:40:36 1991
  16.  *  Updated for IGadSpell: LJR  Sun Dec  8 07:19:48 1991
  17.  *  Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
  18.  *  Copyright © 1991  Loren J. Rittle
  19.  *  Use as you will, just document your changes and keep my copyright
  20.  *  notice intact.
  21.  *
  22.  *  Loren J. Rittle
  23.  *  l-rittle@uiuc.edu
  24.  */
  25. options results
  26.  
  27. if pos('IRexxSpell',(show(ports))) = 0 then do
  28.   address command 'run <nil: >nil: ispell -r <nil: >nil:'
  29.   address command waitforport 'IRexxSpell'
  30. end
  31.  
  32. status 87; bytepos = result;
  33. status 55; line = result;
  34. parse var line curline '0a'x
  35.  
  36. curpos = 0
  37. do forever
  38.   curpos=pos('09'x, curline, curpos+1)
  39.   if curpos == 0 then break
  40.   curline = overlay(' ', curline, curpos)
  41. end
  42.  
  43. do i = 1 to words(curline)
  44.   if wordindex(curline, i)-1 > bytepos then
  45.     break
  46.   end
  47.  
  48. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  49.  
  50. if item = '' then exit
  51.  
  52. address 'IRexxSpell' quickcheck item
  53. if result = 'bad' then do
  54. /* Uncomment the following if you want QuickWordSpell.ced to fire up
  55.    GUISpell on a spelling error. */
  56. /*    if pos('GUISpell',(show(ports))) = 0 then do
  57.         address command 'run <nil: >nil: GUISpell <nil: >nil:'
  58.         address command waitforport 'GUISpell'
  59.       end*/
  60.     if pos('GUISpell',(show(ports))) ~= 0 then
  61.       address 'GUISpell' check item
  62.     address 'PingServer' beep
  63.   end
  64. exit
  65.